package com.bsc.rtc.lib.libraries.behavior.sampleTitleBehavior;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.bsc.rtc.lib.libraries.R;
import com.bsc.rtc.lib.libraries.RecycleViewBase.CommonAdapter;
import com.bsc.rtc.lib.libraries.RecycleViewBase.base.ViewHolder;

import java.util.ArrayList;
import java.util.List;
//https://www.jianshu.com/p/b987fad8fcb4
public class BehaviorActivity extends AppCompatActivity {
    RecyclerView recyclerView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       // setContentView(R.layout.activity_behavior);
        setContentView(R.layout.activity_test1);
        initView();
    }
    private void initView(){
        List<String> list=new ArrayList<>();
        for(int i=0;i<100;i++){
            list.add("1");
        }

        recyclerView=findViewById(R.id.my_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(new CommonAdapter<String>(BehaviorActivity.this,R.layout.item_ry_layout,list) {

            @Override
            protected void convert(ViewHolder holder, String s, int position) {
                    holder.setText(R.id.item,s);
            }
        });
    }
}
